<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<html>
<head>
<%@ include file="common.jsp"%>
<link type="text/css" rel="stylesheet" href="<%=rootPath%>/css/manage/selectResult.css" />
<title><%=proName%>-日志权限</title>
<script type="text/javascript">
	//新增权限组
	function addGroupPower(){
		//var valueA = $('input:radio:checked').val()
		//alert(valueA);
		location.href = rootPath+"/jsp/manage/workConManagerGroupAdd.jsp";
	}

	//查询权限人员列表
	function select1(){
 		searchtForm.target="_self";
 		searchtForm.submit();
	}
	//删除选中的人员
    function deleteGroupPower(){
      	var url = deleteForm.action;
      	var viewEmp = $('input:radio:checked').val();
      	if(viewEmp==undefined||viewEmp.length==0){
      		alert("请选中选项！");
      		location.reload();
      		return;
      	}
      	var comfirmStr = "您确认删除已选中的人员"+viewEmp+"的阅读日志权限？";
      	//alert(comfirmStr);
      	if(confirm(comfirmStr)){
      		$.ajax({
      		  	url: url,
      		  	type: "POST",
      		  	data:"viewEmp="+viewEmp,
      		  	dataType: "text",
      		  	success: function( response ) {
      		  		var data=$.parseJSON(response);
      				if(data.state=="200"){
      					location.reload();
      				}else{
      					alert('fail',data.msg);
      				}
      		  	}
      		});
      	}
      }
	//进入添加页面
      function updateGroupPower(){
    	var viewEmp = $('input:radio:checked').val();
    	//alert(viewEmp);
    	if(viewEmp==undefined){
    		alert("请选择一个选项")
    		location.reload();
    	}else{
    		location.href = "<%=rootPath%>/workConPower/updateGroupPower.mge?viewEmp="+viewEmp;
    	}
	}
</script>
</head>

<body>
	<jsp:include page="./menu.jsp"></jsp:include>
	<div id="body">
		<div id="navTop">
			<div class="bg_left"></div>
			<div class="bg_main"></div>
			<div class="bg_right"></div>
		</div>
		<div id="userManager">
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="maintable" >
				<tr>
					<td><h5>以下为权限组查询结果:</h5></td>
				</tr>
				<tr>
					<th align="right">
						<input type="button" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" value="新增权限组" onclick="addGroupPower()" onmouseover="this.style.background='#FFF18B'" onmouseout="this.style.background='#F1EDD2'" />
						<input type="button" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" value="删除权限组" onclick="deleteGroupPower()" onmouseover="this.style.background='#FFF18B'" onmouseout="this.style.background='#F1EDD2'" />
						<input type="button" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" value="修改权限组" onclick="updateGroupPower()" onmouseout="this.style.background='#F1EDD2'" />
					</th>
				</tr>
				<tr>
					<td>
						<form id="deleteForm" method="post" name="deleteForm" action="<%=rootPath%>/workConPower/deleteManagerGroup.mge" title=''>
							<table class="admintable" width="100%" style="margin: auto">
								<tr>
									<th class="adminth"></th>
									<th class="adminth">有查阅日志权限员工</th>
									<th class="adminth">被查阅日志员工</th>
								</tr>
								<c:forEach items="${groups}" var="group" varStatus="s">
									<tr style="background-color: <c:if test="${s.index%2==0 }">#F7F4D8</c:if><c:if test="${s.index%2!=0 }">#FFF</c:if>">
										<td align="center" style="width:5%"><input type="radio" name="valueA" value=${group.key}/></td>
										<td align="left" style="width:20%">${group.key}</td>
										<td align="left" style="width:75%"><c:if test="${group.value=='ALL'}">全部B类权限</c:if><c:if test="${group.value!='ALL'}">${group.value}</c:if> </td>
									</tr>
								</c:forEach>
							</table>
						</form>
					</td>
				</tr>
				
			</table>
		</div>
	</div>
	<jsp:include page="./footer.jsp"></jsp:include>
</body>
</html>
